
<%@page language="java" pageEncoding="utf-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
  <!-- [Head] start -->
  <head>
    <title>查看所有房屋信息</title>
    <!-- [Meta] -->
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta
      name="description"
      content="Berry is made using Bootstrap 5 design framework. Download the free admin template & use it for your project."
    />
    <meta name="keywords" content="Berry, Dashboard UI Kit, Bootstrap 5, Admin Template, Admin Dashboard, CRM, CMS, Bootstrap Admin Template" />

    <!-- [Favicon] icon -->
    <link rel="icon" href="/myhouse/static/mediator/images/favicon.svg" type="image/x-icon" />
 <!-- [Google Font] Family -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" id="main-font-link" />
<!-- [Tabler Icons] https://tablericons.com -->
<link rel="stylesheet" href="/myhouse/static/mediator/fonts/tabler-icons.min.css" />
<!-- [Material Icons] https://fonts.google.com/icons -->
<link rel="stylesheet" href="/myhouse/static/mediator/fonts/material.css" />
<!-- [Template CSS Files] -->
<link rel="stylesheet" href="/myhouse/static/mediator/css/style.css" id="main-style-link" />
<link rel="stylesheet" href="/myhouse/static/mediator/css/style-preset.css" id="preset-style-link" />

    <style>
      table {
        width: 800px;
        border-collapse: collapse;
        margin: 0 auto;
      }
      td {
        border: 1px solid #ccc;
        padding: 8px;
        text-align: center;
      }
      th {
        background-color: #f2f2f2;
        border: 1px solid #ccc;
        padding: 8px;
        text-align: center;
      }
      tr:nth-child(even) {
        background-color: #f9f9f9;
      }
      /*所有页码的div*/
      #mydiv{
        position: relative;
        left: 300px;
        top: 30px;
      }
      /*分页页码div*/
      .pageNumDiv{
        width: 40px;
        height: 40px;
        border-radius: 20px;
        background-color: #24BCFF;
        margin-left: 50px;
        float: left;
        /*div内文字居中*/
        display:flex;
        justify-content:center;
        align-items:center;
        /*阴影效果*/
        box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.1);
      }

      .pageNumDivUp{
        width: 60px;
        height: 40px;
        border-radius: 20px;
        background-color: #24BCFF;
        margin-left: 50px;
        float: left;
        display:flex;
        justify-content:center;
        align-items:center;
        /*阴影效果*/
        box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.1);
      }
      .pageNumDivDown{
        width: 60px;
        height: 40px;
        border-radius: 20px;
        background-color: #24BCFF;
        margin-left: 50px;
        float: left;
        display:flex;
        justify-content:center;
        align-items:center;
        /*阴影效果*/
        box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.1);
      }
      .pageInfo{
        color: white;
      }
    </style>
  </head>
  <!-- [Head] end -->
  <!-- [Body] Start -->
  <body>

    <!-- [ Pre-loader ] start -->
<div class="loader-bg">
  <div class="loader-track">
    <div class="loader-fill"></div>
  </div>
</div>
<!-- [ Pre-loader ] End -->
 <!-- [ Header Topbar ] start -->
    <jsp:include page="/inc/mediatorTop.jsp"></jsp:include>
<!-- [ Header ] end -->
 <!-- [ Sidebar Menu ] start -->
<nav class="pc-sidebar">
  <div class="navbar-wrapper">
    <div class="m-header">
      <a href="index.jsp" class="b-brand">
        <!-- ========   Change your logo from here   ============ -->
        <img src="/myhouse/static/mediator/images/logo-dark.svg" alt="" class="logo logo-lg" />
      </a>
    </div>
    <jsp:include page="/inc/mediatorLeft.jsp"></jsp:include>
  </div>
</nav>
<!-- [ Sidebar Menu ] end -->



    <!-- [ Main Content ] start -->
    <div class="pc-container">
      <div class="pc-content">
        <!-- [ breadcrumb ] start -->
        <div class="page-header">
          <div class="page-block">
            <div class="row align-items-center">
              <div class="col-md-12">
                <div class="page-header-title">
                  <h5 class="m-b-10">查看所有房屋信息</h5>
                </div>
                <ul class="breadcrumb">
                  <li class="breadcrumb-item"><a href="/myhouse/mediator/index">首页</a></li>
                  <li class="breadcrumb-item"><a href="javascript: void(0)">管理房屋</a></li>
                  <li class="breadcrumb-item" aria-current="page">查看所有房屋信息</li>
                </ul>
              </div>
            </div>
          </div>
        </div>
        <!-- [ breadcrumb ] end -->


        <!-- [ Main Content ] start -->
        <div class="row">
          <!-- [ sample-page ] start -->
          <div class="col-sm-12">
            <div class="card">
              <div class="card-header">
                <h5>查看所有房屋信息</h5>
              </div>
              <div class="card-body" style="height: 500px">
                  <table>
                    <tr>
                      <th>id</th>
                      <th>区县</th>
                      <th>类型</th>
                      <th>房间数</th>
                      <th>价格（元）</th>
                      <th>面积（㎡）</th>
                      <th colspan="2">操作</th>
                    </tr>
                    <c:forEach items="${requestScope.houseList}" var="house">
                      <tr>
                        <td>${house.id}</td>
                        <td>${house.city}</td>
                        <td>${house.type}</td>
                        <td>${house.room}</td>
                        <td>${house.price}</td>
                        <td>${house.area}</td>
                        <td><a href="/myhouse/mediator/iconTabler?id=${house.id}" style="color: #24BCFF">修改</a></td>
                        <td><a href="/myhouse/mediator/bcTypography?id=${house.id}" style="color: #24BCFF">删除</a></td>
                      </tr>
                    </c:forEach>

                  </table>

                <div id="mydiv">
                <c:if test="${requestScope.paper.pageNO > 1}">
                <%--  页码div --%>
                  <div class="pageNumDivUp" >
                  <a class="pageInfo" href="/myhouse/mediator/showHouse?pon=${requestScope.paper.pageNO-1}&&mediatorId=${sessionScope.mediator.id}">上一页</a>
                  </div>
                </c:if>
                <c:forEach begin="1" end="${requestScope.paper.pageCount}" var="i">
<%--                  <div class="pageNumDiv">--%>
<%--                  <a class="pageInfo" href="/myhouse/mediator/showHouse?pon=${i}&&mediatorId=${sessionScope.mediator.id}"><span>${i}</span></a></li>--%>
<%--                  </div>--%>
                  <c:if test="${requestScope.paper.pageNO==i}">
                    <div class="pageNumDiv">
                      <a href="/myhouse/mediator/showHouse?pon=${i}&&mediatorId=${sessionScope.mediator.id}" style="color: red;"><span>${i}</span></a></li>
                    </div>
                  </c:if>
                  <c:if test="${requestScope.paper.pageNO ne i}">
                    <div class="pageNumDiv">
                      <a href="/myhouse/mediator/showHouse?pon=${i}&&mediatorId=${sessionScope.mediator.id}" style="color: white;"><span>${i}</span></a></li>
                    </div>
                  </c:if>
                </c:forEach>
                <c:if test="${requestScope.paper.pageNO < requestScope.paper.pageCount }">
                  <div class="pageNumDivDown">
                  <a class="pageInfo"  href="/myhouse/mediator/showHouse?pon=${requestScope.paper.pageNO+1}&&mediatorId=${sessionScope.mediator.id}">下一页</a>
                  </div>
                </c:if>
                </div>

              </div>
            </div>
          </div>
        </div>

      </div>
    </div>
 <!-- Required Js -->
<script src="/myhouse/static/mediator/js/plugins/popper.min.js"></script>
<script src="/myhouse/static/mediator/js/plugins/simplebar.min.js"></script>
<script src="/myhouse/static/mediator/js/plugins/bootstrap.min.js"></script>
<script src="/myhouse/static/mediator/js/config.js"></script>
<script src="/myhouse/static/mediator/js/pcoded.js"></script>

  </body>
  <!-- [Body] end -->
</html>
